var express = require('express');
var router = express.Router();

let mgdb = require('../../utils/mgdb')

router.get('/', (req, res, next) => {

  //开库
  mgdb.open({
    collectionName: 'follow'
  }).then(
    ({ collection, client, ObjectId }) => {
      //查询库，根据token
      collection.find().toArray((err, result) => { 
        if(err){
          res.send({err:1,msg:'集合操作失败'})
        }else{
         
            res.send({err:0,msg:'自动登陆成功',data:result})
         
        }
        client.close()
      })
    }
  )
})



